#!/bin/sh /etc/rc.common

START=99
USE_PROCD=1

start_service()
{
	procd_open_instance
	procd_set_param env HOME=/root NODE_PATH=/opt/zwave-js-ui-bundle/node_modules:/opt/zwave-js-ui-bundle/node_modules/@zwave-js/core/node_modules STORE_DIR=/etc/zwave-js-ui-bundle ZWAVEJS_EXTERNAL_CONFIG=/etc/zwave-js-ui-bundle/config-db
	procd_set_param command /usr/bin/node --optimize_for_size --max_old_space_size=128 --gc_interval=100 /opt/zwave-js-ui-bundle/index.js
	procd_set_param respawn
	procd_set_param stdout 1
	procd_set_param stderr 1
	procd_set_param term_timeout 60
	procd_close_instance
}
